<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('username')->comment('用户名');
            $table->string('nickname')->comment('昵称');
            $table->char('phone',11)->comment('电话')->nullable();
            $table->string('openid')->comment('微信用户id')->nullable();
            $table->unsignedTinyInteger('status')->comment('状态 1：启用 2：禁用');
            $table->string('note')->nullable()->comment('备注');
            $table->timestamps();
        });

        \Illuminate\Support\Facades\DB::statement("alter table `users` comment '后台用户表'");
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('users');
    }
};
